const stateOptions = [
	{ label: "待执行", value: 0 },
	{ label: "执行中", value: 1 },
	{ label: "已完成", value: 2 },
	{ label: "执行失败", value: 3 }
];

//表单配置项
const formItemData = {
	templateName: {
		itemConfig: {
			name: "templateName"
		},
		elConfig: {
			formType: "Input",
			placeholder: "模板名称"
		}
	},
	applyModule: {
		itemConfig: {
			name: "applyModule"
		},
		elConfig: {
			formType: "Input",
			placeholder: "应用模块"
		}
	},
	size: {
		itemConfig: {
			name: "size"
		},
		elConfig: {
			formType: "Select",
			placeholder: "模版尺寸",
			options: stateOptions
		}
	},
    ecStoreIds: {
		itemConfig: {
			name: "ecStoreIds"
		},
		elConfig: {
			formType: "SelectShop",
			placeholder: "请选择店铺",
		}
	},
	labelType: {
		itemConfig: {
			name: "labelType"
		},
		elConfig: {
			formType: "Select",
			placeholder: "标签类型",
			options: stateOptions
		}
	}
};

//处理表单数据
export const getFormItem = optionsData => {
	const arr = [];
	Object.keys(formItemData).map(v => {
		if (optionsData && optionsData[v]) {
			formItemData[v].elConfig.options = optionsData[v];
		}
		arr.push(formItemData[v]);
	});
	return arr;
};
